$(function(){

	jQuery.axhttp = function(url, reqType, params, sucallback, isLoading, layerMsg){
		$.ajax({
	        url : url,
	        type : reqType,
	        data : params,
	        timeout:60000,
	        beforeSend:function(XMLHttpRequest){ 	
	        	// layer.load(2);
				if(isLoading == true) {
					LOADING.showLoading();
				}
	        },
	        
	        success : function(data) {
				LOADING.hideLoading();
				layer.closeAll();
				
				if(data.responseCode == 1001){
					
					if(!Utils.isEmpty(layerMsg)) {
						layer.msg(layerMsg, {time: 1000});
					}
				}else{

					//这儿需要提示
				}
				
	        	sucallback(data);
	        },
	        
	        error : function(XMLHttpRequest, textStatus, errorThrown) {
				LOADING.hideLoading();
	        	LOADING.hideLoading();
	        	layer.closeAll();
	        	
	        	if(textStatus == "timeout"){
	                // 超时,status还有success,error等值的情况
	            	layer.msg("访问超时，请检查网络是否正常!", {shift : 6});
	            }else{            	
	            	layer.msg("网络错误,请刷新重试!", {shift : 6});
	            }
	        }
		});
	};
	
});

